1. Field of the Invention
The present invention relates to a robot teaching apparatus used in an operation for teaching a motion position to an industrial robot.
2. Description of the Related Art
As a typical technique which is often employed for teaching a motion position of a robot, there is a so-called playback system. When this technique is used, a robot is manually moved to a position where the robot must move actually, and its position is stored in a robot controller.
As another typical technique, there is a so-called off-line teaching. In this technique, using an off-line programming device, an environmental model including a robot and/or an object to be worked is established and a position to which the robot has to move is obtained according to the model by a calculation. The teaching position thus obtained is stored in a robot controller, for example, through a transfer.
When the playback system is employed, since positions required for an operation of the robot (positions to be taught) are taught to the robot one by one, much time and labor are required. It is not rare that the number of teaching positions required for an actual work amounts to a large number (for example, 100).
On the other hand, when the off-line teaching is utilized, it is necessary to input a model of a motion object into an off-line teaching device. In this case, there is a drawback in that, unless a shape of the object is defined as a CAD model or the like in advance, it is difficult to input the shape accurately and much time is required for inputting the shape model.
An object of the present invention is to provide a robot position teaching apparatus which can perform an operation position teaching operation of a robot easily with a high accuracy. Also, another object of the invention is to provide a robot position teaching apparatus which is suitable particularly for a movement path teaching for a robot performing operation while moving along a linear or curved operation route.
For achieving the above object, in the present invention, positions of points on an operating line of a work object are measured by a 3-dimensional position and attitude measuring device (sensor) constituted by a camera and light projecting means. Teaching point data for operating a robot is created from information about 3-dimensional positions of points constituting the working line, which is obtained from this measurement.
The light projecting means projects a pattern light (which is typically a slit light or a spot light) in the vicinity of a point to be measured (hereinafter, referred to as a xe2x80x9cmeasurement pointxe2x80x9d). An object projected with the pattern light is photographed by a camera, and information about a 3-dimentional position of the portion on which the pattern light is projected is captured by image analysis.
Here, as is well-known, in a case where such a pattern light is a slit light, measurement is made by projecting slit lights on a measurement point from two different directions and a 3-dimensional position and an orientation of a face (plane) in the vicinity of the measurement point are calculated from the measurement result.
On the other hand, in a case where such a pattern light is a spot light, measurement is made by projecting spot lights on three or more different points which are not on a straight line and a 3-dimentional position and an orientation of a plane on which these points are positioned are calculated from the measurement result.
In this case, three points positioned near one another are selected and one of these points is set as a target measurement point, or three points (or more points) positioned near a target measurement point are selected and a 3-dimensional position and an orientation of a plane on which the target measurement point is positioned are obtained from the measurement results of these points. For example, the measurement position can be caused to correspond to the geometrical center of gravity position formed by the three points.
Briefly speaking, in the present invention, the 3-dimensional position sensor provided with light projecting means of such a pattern light as a slit light, a spot light or the like and a camera is utilized so that a 3-dimensional position of a target measurement point is measured. Also, an inclination (orientation) of a surface (an area near the measurement point which can be regarded as a flat plane) is calculated together with the measurement of the 3-dimensional position. The attitude of the target measurement point can be represented by this orientation of the surface.
Incidentally, well known is a principle which uses the 3-dimensional position sensor provided with light projecting means of such a pattern light as a slit light, a spot light or the like and a camera to obtain a 3-dimentional position of a target measurement point. That is, by using data obtained through calibration regarding the light projecting means and the camera, a 3-dimensional position of a target point can be calculated within a sensor or the like from the position of a measurement point on an image obtained by the camera and a light projecting state (data representing projecting orientation and position of the pattern light) at this time.
In a case where the light projector or the camera of the 3-dimensional position sensor is mounted on a distal end portion of a hand of a robot, the 3-dimensional position of the target point can once be obtained on a coordinate system (for example, a tool coordinate system) fixed on the distal end portion of the hand of the robot. Even in such a case, by using data about the current position of the robot at this time, the coordinate system can easily be converted to a coordinate system (for example, a world coordinate system, a work coordinate system or the like) fixed to a working space.
Here, when the above target measurement points are sequentially defined and measured along a working line on an object to be measured, teaching points for a working robot for performing work along the working line can be obtained.
In view of the above, a robot teaching apparatus according to the present invention is a robot teaching apparatus of a type that a teaching robot mounted with light projecting means for projecting a slit light or a spot light on an object as a pattern light and a camera is used to perform working along a working line on the object, and comprises: means for obtaining a 3-dimensional position and an orientation of a face of an object on which the pattern light has been projected, from an image of the camera about the face of the object; means for specifying points constituting the working line on the image of the camera; and means for obtaining the specified 3-dimentional positions of the points constituting the working line, on the basis of the 3-dimensional position and the attitude of the face and the positions of the points on the camera image constituting the working line.
By using the robot teaching apparatus according to the present invention, it becomes unnecessary to perform a playback motion on an object robot to be taught. Also, it is not required to constitute a model for an off-line teaching, so that a teaching work for a robot can easily be performed.